/*
 * Powered By [pkuWx]
 * Web Site: http://www.wuxi.ss.pku.edu.cn
 * Since 2015 - 2015
 */

package cn.edu.pku.wxlib.operatelog.model;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import cn.org.rapid_framework.util.DateConvertUtils;

import java.util.*;

import cn.edu.pku.wxlib.operatelog.model.*;
import cn.edu.pku.wxlib.operatelog.service.*;
import cn.edu.pku.wxlib.operatelog.vo.query.*;

import javacommon.base.*;
import javacommon.util.*;
import javacommon.page.Page;

/**
 * @version 1.0
 * @since 1.0
 */


public class Operatelog extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "Operatelog";
	public static final String ALIAS_OPERATE_LOG_ID = "operateLogId";
	public static final String ALIAS_ADMIN_NAME = "管理员用户名";
	public static final String ALIAS_OPERATE_LOG_NAME = "借阅的日志";
	public static final String ALIAS_OPERATE_TIME = "操作时间";
	public static final String ALIAS_OPERATE_TYPE = "1借书，2还书，3续借";
	public static final String ALIAS_DESCRIPTION = "详情";
	
	//date formats
	public static final String FORMAT_OPERATE_TIME = DATE_FORMAT;
	
	//columns START
    /** operateLogId       db_column: operateLogId */	
	
	private java.lang.Integer operateLogId;
    /** 管理员用户名       db_column: adminName */	
	@Length(max=32)
	private java.lang.String adminName;
    /** 借阅的日志       db_column: operateLogName */	
	@NotBlank @Length(max=64)
	private java.lang.String operateLogName;
    /** 操作时间       db_column: operateTime */	
	
	private java.util.Date operateTime;
    /** 1借书，2还书，3续借       db_column: operateType */	
	
	private java.lang.Integer operateType;
    /** 详情       db_column: description */	
	@Length(max=256)
	private java.lang.String description;
	//columns END

	public Operatelog(){
	}

	public Operatelog(
		java.lang.Integer operateLogId
	){
		this.operateLogId = operateLogId;
	}

	public void setOperateLogId(java.lang.Integer value) {
		this.operateLogId = value;
	}
	
	public java.lang.Integer getOperateLogId() {
		return this.operateLogId;
	}
	public void setAdminName(java.lang.String value) {
		this.adminName = value;
	}
	
	public java.lang.String getAdminName() {
		return this.adminName;
	}
	public void setOperateLogName(java.lang.String value) {
		this.operateLogName = value;
	}
	
	public java.lang.String getOperateLogName() {
		return this.operateLogName;
	}
	public String getOperateTimeString() {
		return DateConvertUtils.format(getOperateTime(), FORMAT_OPERATE_TIME);
	}
	public void setOperateTimeString(String value) {
		setOperateTime(DateConvertUtils.parse(value, FORMAT_OPERATE_TIME,java.util.Date.class));
	}
	
	public void setOperateTime(java.util.Date value) {
		this.operateTime = value;
	}
	
	public java.util.Date getOperateTime() {
		return this.operateTime;
	}
	public void setOperateType(java.lang.Integer value) {
		this.operateType = value;
	}
	
	public java.lang.Integer getOperateType() {
		return this.operateType;
	}
	public void setDescription(java.lang.String value) {
		this.description = value;
	}
	
	public java.lang.String getDescription() {
		return this.description;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("OperateLogId",getOperateLogId())
			.append("AdminName",getAdminName())
			.append("OperateLogName",getOperateLogName())
			.append("OperateTime",getOperateTime())
			.append("OperateType",getOperateType())
			.append("Description",getDescription())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getOperateLogId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof Operatelog == false) return false;
		if(this == obj) return true;
		Operatelog other = (Operatelog)obj;
		return new EqualsBuilder()
			.append(getOperateLogId(),other.getOperateLogId())
			.isEquals();
	}
}

